<?php
require_once './admin-header.php';

require_once './core/admin-sql.php';
$sql = new AdminSql();
$result_array = $sql->searchAllUidForms($_SESSION['uid']);
if ($result_array[0] > 0) {
    $num_ra = count($result_array[1]);
    $new_form_id = $result_array[1][0] + 1;
} else {
    $new_form_id = 1;
}
?>
    <!DOCTYPE html>
    <html lang="zh-CN">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="initial-scale=1.0,width=device-width,user-scalable=0,maximum-scale=1.0"/>
        <title>我的</title>
        <link rel="stylesheet" href="../css/base.css">
        <link rel="stylesheet" href="../css/index.css">
        <link rel="stylesheet" href="./css/jquery.xctips.css"/>

        <link rel="icon" type="image/png" href="assets/i/favicon.png">
        <link rel="apple-touch-icon-precomposed" href="assets/i/app-icon72x72@2x.png">

        <script>
            function adapte() {//适配
                var designWidth = 1080, rem2px = 100;
                document.documentElement.style.fontSize = window.innerWidth / designWidth * rem2px + "px";
            }
            adapte();
        </script>
        <style>
        </style>
    </head>
    <body>
    <div class="my">
        <div class="my-top">
            <div class="avator flex3">
                <img src="../img/avator.jpg" alt="头像" title="头像">
                <span class="fs36 b"><?= $_SESSION['username'] ?></span>
            </div>
            <ul class="apply-num clearfix">
                <li class="fl">
                    <p class="fs60"><?= $sql->todayPosts($_SESSION['uid']) ?></p>
                    <p class="fs30">今天报名(人)</p>
                </li>
                <li class="fr">
                    <p class="fs60"><?= $sql->allPosts($_SESSION['uid']) ?></p>
                    <p class="fs30">累计报名(人)</p>
                </li>
            </ul>
        </div>
        <div class="my-bottom">
            <ul class="flex fs36">
                <li>
                    <a class="flex" href="myPoster.php">
                        <img src="../img/my-1.jpg" alt="我的海报">
                        <span>我的海报</span>
                    </a>
                </li>
                <li>
                    <a class="flex" href="myApply1.php">
                        <img src="../img/my-2.jpg" alt="我的报名">
                        <span>我的报名</span>
                    </a>
                </li>
                <li>
                    <a class="flex" href="javascript:;" onclick="addNewForm(<?= $_SESSION['uid'] ?>, <?= $new_form_id ?>)">
                        <img src="../img/my-3.jpg" alt="海报制作">
                        <span>海报制作</span>
                    </a>
                </li>
                <li>
                    <a class="flex" href="set1.php">
                        <img src="../img/my-4.jpg" alt="更多设置">
                        <span>海报设置</span>
                    </a>
                </li>
                <li>
                    <a class="flex" href="set2.php">
                        <img src="../img/my-4.jpg" alt="更多设置">
                        <span>报名成功设置</span>
                    </a>
                </li>
                <li>
                    <a class="flex" href="javascript:;" onclick="logout()">
                        <img src="../images/logout.jpg" alt="退出登录">
                        <span>退出登录</span>
                    </a>
                </li>
            </ul>
        </div>
    </div>
    <script src='../script/jquery.js'></script>
    <script src='../script/index.js'></script>
    </body>
    </html>

<?php

require_once './admin-footer.php';